Skip to content

resolve flaky ChunkLinkDownloadServiceTest.testBatchDownloadChaining …#842

Merged
jayantsing-db merged 2 commits into
mainfrom
jayantsing-db/fix-flaky-concurrent-test
Jun 20, 2025
Merged

resolve flaky ChunkLinkDownloadServiceTest.testBatchDownloadChaining …#842
jayantsing-db merged 2 commits into
mainfrom
jayantsing-db/fix-flaky-concurrent-test

Conversation

@jayantsing-db

@jayantsing-db jayantsing-db commented May 30, 2025

Copy link
Copy Markdown
Collaborator

…in CI

NO_CHANGELOG=true

Description

The test was intermittently failing on GitHub Actions with getResultChunks() being called 3 times instead of the expected 1 time, while consistently passing locally.

Root cause:

  • Race condition between concurrent getLinkForChunk() calls and expired link detection
  • Test used expiration date "2025-02-16T00:00:00Z" which could be considered expired depending on SECONDS_BUFFER_FOR_EXPIRY and timing
  • When multiple threads detected expired links, they triggered multiple reset operations
  • Different thread scheduling between local Mac and GitHub Actions runners exposed the issue

Changes:

  • Use far future expiration dates (2030-12-31) to prevent unintended link expiration

Testing

Additional Notes to the Reviewer

…in CI

The test was intermittently failing on GitHub Actions with getResultChunks() being
called 3 times instead of the expected 1 time, while consistently passing locally.

Root cause:
- Race condition between concurrent getLinkForChunk() calls and expired link detection
- Test used expiration date "2025-02-16T00:00:00Z" which could be considered expired
  depending on SECONDS_BUFFER_FOR_EXPIRY and timing
- When multiple threads detected expired links, they triggered multiple reset operations
- Different thread scheduling between local Mac and GitHub Actions runners exposed the issue

Changes:
- Use far future expiration dates (2030-12-31) to prevent unintended link expiration
@jayantsing-db jayantsing-db merged commit 33f02ce into databricks:main Jun 20, 2025
16 checks passed
@jayantsing-db jayantsing-db deleted the jayantsing-db/fix-flaky-concurrent-test branch June 20, 2025 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants